package cn.imnu.legalaid.mapper;

import cn.imnu.legalaid.entity.LawyerProfiles;
import cn.imnu.legalaid.dto.Lawyer.LawyerListDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface LawyerProfilesMapper extends BaseMapper<LawyerProfiles> {
    
    /**
     * 分页查询律师列表
     */
    IPage<LawyerListDTO> selectLawyerList(
        Page<LawyerListDTO> page,
        @Param("searchQuery") String searchQuery,
        @Param("specialtyFilter") String specialtyFilter,
        @Param("minExperience") Integer minExperience,
        @Param("maxExperience") Integer maxExperience,
        @Param("sortBy") String sortBy
    );
    
    /**
     * 获取所有专业领域
     */
    @Select("SELECT DISTINCT specialty FROM lawyer_specialties WHERE specialty IS NOT NULL AND specialty != ''")
    List<String> selectAllSpecialties();
}




